home *** CD-ROM | disk | FTP | other *** search
- // Textures: Tiles4, Tiles8 and Tiles16. Each have (texturename)^2
- // (solid) color blocks per unit square.
- // Uses tiles{} special texture.
- //
- // Written 24/04/94 by Jussi Kantola (jkantola@paju.oulu.fi)
-
- // These are the sixteen colors, just for example.
- // The texture looks great with "random" colors too!
-
- #declare C1 = color rgb <4/4, 0, 0> // Tiles4, Tiles8, Tiles16
- #declare C2 = color rgb <3/4, 0, 0> // Tiles4, Tiles8, Tiles16
- #declare C3 = color rgb <2/4, 0, 0> // Tiles4, Tiles8, Tiles16
- #declare C4 = color rgb <1/4, 0, 0> // Tiles4, Tiles8, Tiles16
- #declare C5 = color rgb <0, 1/4, 0> // Tiles8, Tiles16
- #declare C6 = color rgb <0, 2/4, 0> // Tiles8, Tiles16
- #declare C7 = color rgb <0, 3/4, 0> // Tiles8, Tiles16
- #declare C8 = color rgb <0, 4/4, 0> // Tiles8, Tiles16
- #declare C9 = color rgb <0, 0, 4/4> // Tiles16
- #declare C10 = color rgb <0, 0, 3/4> // Tiles16
- #declare C11 = color rgb <0, 0, 2/4> // Tiles16
- #declare C12 = color rgb <0, 0, 1/4> // Tiles16
- #declare C13 = color rgb <1/4, 1/4, 0> // Tiles16
- #declare C14 = color rgb <2/4, 2/4, 0> // Tiles16
- #declare C15 = color rgb <3/4, 3/4, 0> // Tiles16
- #declare C16 = color rgb <4/4, 4/4, 0> // Tiles16
-
- /*#declare C1 = color rgb <4/4, 1/4, 1/4> // Tiles4, Tiles8, Tiles16
- #declare C2 = color rgb <4/4, 2/4, 2/4> // Tiles4, Tiles8, Tiles16
- #declare C3 = color rgb <4/4, 3/4, 3/4> // Tiles4, Tiles8, Tiles16
- #declare C4 = color rgb <4/4, 4/4, 4/4> // Tiles4, Tiles8, Tiles16
- #declare C5 = color rgb <1/4, 1/4, 4/4> // Tiles8, Tiles16
- #declare C6 = color rgb <2/4, 2/4, 4/4> // Tiles8, Tiles16
- #declare C7 = color rgb <3/4, 3/4, 4/4> // Tiles8, Tiles16
- #declare C8 = color rgb <4/4, 4/4, 4/4> // Tiles8, Tiles16
- #declare C9 = color rgb <1/4, 4/4, 1/4> // Tiles16
- #declare C10 = color rgb <2/4, 4/4, 2/4> // Tiles16
- #declare C11 = color rgb <3/4, 4/4, 3/4> // Tiles16
- #declare C12 = color rgb <4/4, 4/4, 4/4> // Tiles16
- #declare C13 = color rgb <1/4, 1/4, 1/4> // Tiles16
- #declare C14 = color rgb <2/4, 2/4, 2/4> // Tiles16
- #declare C15 = color rgb <3/4, 3/4, 3/4> // Tiles16
- #declare C16 = color rgb <4/4, 4/4, 4/4> // Tiles16
- */
-
- /*#declare C1 = color Red
- #declare C2 = color Green
- #declare C3 = color Blue
- #declare C4 = color Yellow
- #declare C5 = color Cyan
- #declare C6 = color Pink
- #declare C7 = color Orange
- #declare C8 = color SkyBlue
- #declare C9 = color White
- #declare C10 = color Black
- #declare C11 = color Tan
- #declare C12 = color SeaGreen
- #declare C13 = color IndianRed
- #declare C14 = color SlateBlue
- #declare C15 = color Khaki
- #declare C16 = color DarkSlateGrey */
-
- // A finish for the tiles; you could use unique finish
- // for each of the colors, but I could not ;-)
-
- #declare Tfinish = finish
- {
- specular 1.0
- roughness 0.01
- diffuse 0.95
- ambient 0.05
- }
-
- // Okay, here comes the first set of the tiles: plain colors.
- // No-one says you have to use solid colors for the blocks:
- // just replace these with stones, woods, clouds...
-
- #declare T1 = texture { pigment { color C1 } finish { Tfinish } }
- #declare T2 = texture { pigment { color C2 } finish { Tfinish } }
- #declare T3 = texture { pigment { color C3 } finish { Tfinish } }
- #declare T4 = texture { pigment { color C4 } finish { Tfinish } }
- #declare T5 = texture { pigment { color C5 } finish { Tfinish } }
- #declare T6 = texture { pigment { color C6 } finish { Tfinish } }
- #declare T7 = texture { pigment { color C7 } finish { Tfinish } }
- #declare T8 = texture { pigment { color C8 } finish { Tfinish } }
- #declare T9 = texture { pigment { color C9 } finish { Tfinish } }
- #declare T10 = texture { pigment { color C10 } finish { Tfinish } }
- #declare T11 = texture { pigment { color C11 } finish { Tfinish } }
- #declare T12 = texture { pigment { color C12 } finish { Tfinish } }
- #declare T13 = texture { pigment { color C13 } finish { Tfinish } }
- #declare T14 = texture { pigment { color C14 } finish { Tfinish } }
- #declare T15 = texture { pigment { color C15 } finish { Tfinish } }
- #declare T16 = texture { pigment { color C16 } finish { Tfinish } }
-
- // Now, the second set; tiles{} inside tiles{}
-
- #declare TA = texture
- {
- tiles
- {
- texture
- {
- tiles
- {
- texture { T1 }
- tile2
- texture { T2 }
- }
- scale 1/2 // these are oh so important!
- }
- tile2
- texture
- {
- tiles
- {
- texture { T3 }
- tile2
- texture { T4 }
- }
- scale 1/2
- }
- }
- }
-
- #declare TB = texture
- {
- tiles
- {
- texture
- {
- tiles
- {
- texture { T5 }
- tile2
- texture { T6 }
- }
- scale 1/2
- }
- tile2
- texture
- {
- tiles
- {
- texture { T7 }
- tile2
- texture { T8 }
- }
- scale 1/2
- }
- }
- }
-
- #declare TC = texture
- {
- tiles
- {
- texture
- {
- tiles
- {
- texture { T9 }
- tile2
- texture { T10 }
- }
- scale 1/2
- }
- tile2
- texture
- {
- tiles
- {
- texture { T11 }
- tile2
- texture { T12 }
- }
- scale 1/2
- }
- }
- }
-
- #declare TD = texture
- {
- tiles
- {
- texture
- {
- tiles
- {
- texture { T13 }
- tile2
- texture { T14 }
- }
- scale 1/2
- }
- tile2
- texture
- {
- tiles
- {
- texture { T15 }
- tile2
- texture { T16 }
- }
- scale 1/2
- }
- }
- }
-
- // This is the final phase in the construction
- // We put TA, TB, TC and TD into tiles{} once
- // again and eventually get 4x4, 8x8 and 16x16
- // checker...
-
- // the colors in effect for this are C1..C4
-
- #declare Tiles4 = texture { TA }
-
- // for this, C1..C8
-
- #declare Tiles8 = texture
- {
- tiles
- {
- texture { TA scale 1/2 }
- tile2
- texture { TB scale 1/2 }
- }
- }
-
- // Here, C1..C16
-
- #declare Tiles16 = texture
- {
- tiles
- {
- texture
- {
- tiles
- {
- texture { TA scale 1/2 }
- tile2
- texture { TB scale 1/2 }
- }
- scale 1/2
- }
- tile2
- texture
- {
- tiles
- {
- texture { TC scale 1/2 }
- tile2
- texture { TD scale 1/2 }
- }
- scale 1/2
- }
- }
- }
-